#include "F_WCPage.h"

extern void setView(QComboBox* target);

int F_WcPage::getStructLen()
{
    return sizeof(ETC_Send);
}

void F_WcPage::getsendUdp(char * ch,int flag)
{
    etc_send=(ETC_Send*)ch;
    memcpy(etc_send->de_name,"sanwei",6);
    //if (rdoGC->isChecked())     //工程算法
        etc_send->sf=1+'0';
   // else                        //理论算法
   //     etc_send->sf=1+'0';
    if (flag==0)                //复位命令
    {
        etc_send->sf='!';
    }
    else if(flag==1)            //延时时间测量命令
    {
        etc_send->sf='#';
    }
    else if (flag==3)           //对时守时测试命令
    {
        etc_send->sf='*';
        etc_send->tbfs=itype+'0';     //电PPS:0  ;光PPS:1
    }
    else                            //flag==2时误差测量
    {
        etc_send->tbfs='0';
        etc_send->bzxz=cboBzSelect->currentIndex()+'0';
        if ((cboBzSelect->currentIndex()==4)||(cboBzSelect->currentIndex()==5))
            etc_send->xdyz=txtBzXdy->text().toFloat();
        else
             etc_send->xdyz=0+'0';
        etc_send->bcxz=cboBcSelect->currentIndex()+'0';
        if (cboBcSelect->currentIndex()<=3)
            etc_send->ydyz=0+'0';
        else if (cboBcSelect->currentIndex()==4)
            etc_send->ydyz=txtBcXdy->text().toFloat();
        else if ((cboBcSelect->currentIndex()==5)||(cboBcSelect->currentIndex()==6))
            etc_send->ydyz=cboBctd->currentText().toFloat();
        etc_send->ft3_tdh=cboBctd->currentText().toInt();
      //  etc_send->xbNum=cboXbcs->currentText().toInt();
    //    etc_send->xbValue=txtXbYxz->text().toFloat();
        etc_send->xbNum=1;
        etc_send->xbValue=1.0;
    }
    if(cboCTPT->currentIndex() == 0) // send the rating of the transformer to hardware
    {
        etc_send->xbValue = txtEdyc->text().toFloat();
    //    etc_send->xbNum = '0'; // 0 for CT, 1 for PT
    }
    else if(cboEdycDw->currentIndex() == 0)
    {
        etc_send->xbValue = txtEdyc->text().toFloat() * 100; // decided by hardware-Zhang
    //    etc_send->xbNum = '1';
    }
    else
    {
        etc_send->xbValue = txtEdyc->text().toFloat() * 57.735;
    //    etc_send->xbNum = '1';
    }
   // char netport[4];    /*输入端口*/
  //  cboInput->currentIndex()
    for(int i=0;i<4;i++)
        etc_send->netport[i]=iNetPort + '0';       //初始化
    etc_send->netport[0]=cboInput->currentIndex()+'0';
    for(int i=0;i<20;i++)
        etc_send->ex[i]=0;
    if (flag==3)           //对时守时测试命令 时间设置
    {
        etc_send->ex[0]=itime >> 24 & 0xFF;
        etc_send->ex[1]=itime >> 16 & 0xFF;
        etc_send->ex[2]=itime >> 8 & 0xFF;
        etc_send->ex[3]=itime  & 0xFF;
    }
}


F_WcPage::F_WcPage(QWidget *parent)
    : QWidget(parent)
{
    QFont ft;
    ft.setPointSize(8);
    ft.setBold(true);




    btnTest=new QPushButton(tr("开始"));
    btnTest->setMinimumWidth(80);
    btnTest->setMinimumHeight(40);
//    QLabel *labSpace=new QLabel("");
//    labSpace->setMinimumWidth(100);

    btnTest->setFont(ft);

    ft.setPointSize(9);




    QLabel *labBzHgq=new QLabel(tr("标准互感器"));
    labBzHgq->setAlignment(Qt::AlignCenter);
//    labBzHgq->setStyleSheet("color:rgb(12,190,65);");
    labBzHgq->setFont(ft);
    QLabel *labBcHgq=new QLabel(tr("被测互感器"));
    labBcHgq->setAlignment(Qt::AlignCenter);
 //   labBcHgq->setStyleSheet("color:rgb(12,190,65);");
    labBcHgq->setFont(ft);
    QLabel *labBfd=new QLabel(tr("百分点(%)"));
    labBfd->setAlignment(Qt::AlignCenter);
  //  labBfd->setStyleSheet("color:rgb(12,190,65);");
    labBfd->setMinimumWidth(150);
    labBfd->setFont(ft);

    ft.setPointSize(10);
    labyxz=new QLabel(tr("有效值(%)"));
 //   labyxz->setStyleSheet("color:rgb(12,190,65);");
    labyxz->setFont(ft);
    labyxz->setMinimumWidth(130);
    QLabel *labxw=new QLabel(tr("相位值(')"));
 //   labxw->setStyleSheet("color:rgb(12,190,65);");
    labxw->setMinimumWidth(130);
    labxw->setFont(ft);

    txtBFB=new QLineEdit();
    txtBFB->setMaximumWidth(150);
    txtBFB->setMinimumHeight(65);

    ft.setPointSize(14);
    txtBFB->setFont(ft);
    ft.setPointSize(10);
//    txtBFB->setStyleSheet("QLineEdit{border-width:0;border-style:solid;background:rgb(14,55,76);color:rgb(255,255,255)}");

    txtBzYxz=new QLineEdit();
    txtBzYxz->setMinimumWidth(130);
   // txtBzYxz->setStyleSheet("QLineEdit{border-width:0;border-style:solid;background:rgb(14,55,76);color:rgb(255,255,255)}");

    txtBzYxz->setFont(ft);
    txtBcYxz=new QLineEdit();
    txtBcYxz->setMinimumWidth(130);
//    txtBcYxz->setStyleSheet("QLineEdit{border-width:0;border-style:solid;background:rgb(14,55,76);color:rgb(255,255,255)}");
    txtBcYxz->setFont(ft);
    txtBzXw=new QLineEdit();
    txtBzXw->setMinimumWidth(130);
 //   txtBzXw->setStyleSheet("QLineEdit{border-width:0;border-style:solid;background:rgb(14,55,76);color:rgb(255,255,255)}");
    txtBzXw->setFont(ft);
    txtBcXw=new QLineEdit();
    txtBcXw->setMinimumWidth(130);
  //  txtBcXw->setStyleSheet("QLineEdit{border-width:0;border-style:solid;background:rgb(14,55,76);color:rgb(255,255,255)}");
    txtBcXw->setFont(ft);

    ft.setPointSize(10);
    QLabel *labBc=new QLabel(tr("比值差(%)"));
    labBc->setFont(ft);
 //   labBc->setStyleSheet("color:rgb(168,190,18);");//12,190,65
    QLabel *labJc=new QLabel(tr("相位差(')"));
    labJc->setFont(ft);
 //   labJc->setStyleSheet("color:rgb(168,190,18);");
    txtBc=new QLineEdit();
    txtJc=new QLineEdit();
    txtBc->setFont(ft);
 //   txtBc->setStyleSheet("QLineEdit{border-width:0;border-style:solid;background:rgb(14,25,26);color:rgb(255,255,255)}");
    txtBc->setMaximumWidth(160);
    txtJc->setFont(ft);
 //   txtJc->setStyleSheet("QLineEdit{border-width:0;border-style:solid;background:rgb(14,25,26);color:rgb(255,255,255)}");
    txtJc->setMaximumWidth(150);

    btnSave=new QPushButton(tr("存储"));
    btnSave->setFont(ft);
    btnSave->setMaximumWidth(100);
    btnSave->setMinimumHeight(60);

    ft.setPointSize(10);
    QLabel *labMax=new QLabel(tr("最大值"));
    labMax->setAlignment(Qt::AlignCenter);
    labMax->setFont(ft);
 //   labMax->setStyleSheet("color:rgb(12,190,65);");
    QLabel *labMin=new QLabel(tr("最小值"));
    labMin->setAlignment(Qt::AlignCenter);
    labMin->setFont(ft);
 //   labMin->setStyleSheet("color:rgb(12,190,65);");
    QLabel *labAvg=new QLabel(tr("平均值"));
    labAvg->setAlignment(Qt::AlignCenter);
    labAvg->setFont(ft);
 //   labAvg->setStyleSheet("color:rgb(12,190,65);");
    QLabel *labBzc=new QLabel(tr("比值差(%)"));
    labBzc->setFont(ft);
 //   labBzc->setStyleSheet("color:rgb(12,190,65);");
    QLabel *labXwc=new QLabel(tr("相位差(')"));
    labXwc->setFont(ft);
 //   labXwc->setStyleSheet("color:rgb(12,190,65);");

    txtMinBc=new QLineEdit();
    txtMinBc->setMinimumWidth(130);
 //   txtMinBc->setStyleSheet("QLineEdit{border-width:0;border-style:solid;background:rgb(14,55,76);color:rgb(255,255,255)}");
    txtMinJc=new QLineEdit();
    txtMinJc->setMinimumWidth(130);
 //   txtMinJc->setStyleSheet("QLineEdit{border-width:0;border-style:solid;background:rgb(14,55,76);color:rgb(255,255,255)}");
    txtMaxBc=new QLineEdit();
    txtMaxBc->setMinimumWidth(130);
  //  txtMaxBc->setStyleSheet("QLineEdit{border-width:0;border-style:solid;background:rgb(14,55,76);color:rgb(255,255,255)}");
    txtMaxJc=new QLineEdit();
    txtMaxJc->setMinimumWidth(130);;
 //   txtMaxJc->setStyleSheet("QLineEdit{border-width:0;border-style:solid;background:rgb(14,55,76);color:rgb(255,255,255)}");
    txtAvgBc=new QLineEdit();
    txtAvgBc->setMinimumWidth(130);
 //   txtAvgBc->setStyleSheet("QLineEdit{border-width:0;border-style:solid;background:rgb(14,55,76);color:rgb(255,255,255)}");
    txtAvgJc=new QLineEdit();
    txtAvgJc->setMinimumWidth(130);
 //   txtAvgJc->setStyleSheet("QLineEdit{border-width:0;border-style:solid;background:rgb(14,55,76);color:rgb(255,255,255)}");

    QGridLayout *gLayout=new QGridLayout;

    //gLayout->addLayout(syncLayout,0,0,1,1);
    gLayout->addWidget(labBzHgq,0,1,1,1);
    gLayout->addWidget(labBcHgq,0,2,1,1);
    gLayout->addWidget(labyxz,1,0,1,1);
    gLayout->addWidget(txtBzYxz,1,1,1,1);
    gLayout->addWidget(txtBcYxz,1,2,1,1);
    gLayout->addWidget(labxw,2,0,1,1);
    gLayout->addWidget(txtBzXw,2,1,1,1);
    gLayout->addWidget(txtBcXw,2,2,1,1);
    gLayout->addWidget(labBfd,0,3,1,1);
    gLayout->addWidget(txtBFB,1,3,2,1);
    gLayout->addWidget(labBc,3,0,1,1);
    gLayout->addWidget(txtBc,3,1,1,1);
    gLayout->addWidget(labJc,3,2,1,1);
    gLayout->addWidget(txtJc,3,3,1,1);
    gLayout->addWidget(btnSave,4,0,1,1);
    gLayout->addWidget(labMax,8,1,1,1);
    gLayout->addWidget(labMin,8,2,1,1);
    gLayout->addWidget(labAvg,8,3,1,1);
    gLayout->addWidget(labBzc,9,0,1,1);
    gLayout->addWidget(txtMaxBc,9,1,1,1);
    gLayout->addWidget(txtMinBc,9,2,1,1);
    gLayout->addWidget(txtAvgBc,9,3,1,1);
    gLayout->addWidget(labXwc,10,0,1,1);
    gLayout->addWidget(txtMaxJc,10,1,1,1);
    gLayout->addWidget(txtMinJc,10,2,1,1);
    gLayout->addWidget(txtAvgJc,10,3,1,1);

    gLayout->setSpacing(0);

    ft.setPointSize(10);
    tabwc=new QTabWidget();
    widgetWc=new QWidget();
    widgetWcData=new QWidget();
    cboTbfs=new QComboBox();
    setView(cboTbfs);
    cboBzSelect=new QComboBox();
    setView(cboBzSelect);
    cboBcSelect=new QComboBox();
    setView(cboBcSelect);
    cboBctd=new QComboBox();
    setView(cboBctd);
    cboCTPT=new QComboBox();
    setView(cboCTPT);
    cboJD=new QComboBox();
    setView(cboJD);
    cboBhCl=new QComboBox();
    setView(cboBhCl);
    txtEdyc=new QLineEdit();
    cboEdycDw=new QComboBox();
    setView(cboEdycDw);
    txtBzXdy=new QLineEdit();
    txtBcXdy=new QLineEdit();
    cboCyfs=new QComboBox();
    setView(cboCyfs);
    txtMac=new QLineEdit();
    txtTestNum=new QLineEdit();
    cboInput=new QComboBox();
    setView(cboInput);
    cboSave=new QComboBox();
    setView(cboSave);
    btnGet=new QPushButton(tr("获取"));

    tabwc->setFont(ft);
    cboTbfs->setFont(ft);
    cboBzSelect->setFont(ft);
    cboBcSelect->setFont(ft);
    cboBctd->setFont(ft);
    cboCTPT->setFont(ft);
    cboJD->setFont(ft);
    cboBhCl->setFont(ft);
    txtEdyc->setFont(ft);
    cboEdycDw->setFont(ft);
    txtBzXdy->setFont(ft);
    txtBcXdy->setFont(ft);
    cboCyfs->setFont(ft);
    txtMac->setFont(ft);
    txtTestNum->setFont(ft);
    cboSave->setFont(ft);
    cboInput->setFont(ft);

    tabwc->setMinimumWidth(500);
    tabwc->setMinimumHeight(300);
    cboTbfs->setMinimumWidth(80);
    cboBzSelect->setMinimumWidth(200);
    cboBcSelect->setMinimumWidth(200);
    cboBctd->setMinimumWidth(70);
    cboCTPT->setMinimumWidth(200);
    cboJD->setMinimumWidth(80);
    cboBhCl->setMinimumWidth(130);
    txtEdyc->setMinimumWidth(80);
    cboEdycDw->setMinimumWidth(70);
    txtBzXdy->setMinimumWidth(100);
    txtBcXdy->setMinimumWidth(100);
    cboCyfs->setMinimumWidth(130);
    txtMac->setMinimumWidth(130);
    txtTestNum->setMaximumWidth(60);
    cboSave->setMinimumWidth(130);
    cboInput->setMinimumWidth(100);

    cboTbfs->addItem(tr("非同步"));
//    cboTbfs->addItem(tr("接收电秒脉冲"));
//    cboTbfs->addItem(tr("接收光秒脉冲"));
//    cboTbfs->addItem(tr("接收B码电信号"));
//    cboTbfs->addItem(tr("接收B码光信号"));
//    cboTbfs->addItem(tr("1588对时"));
    cboBhCl->addItem(tr("测量通道"));
    cboBhCl->addItem(tr("保护通道"));
    cboBzSelect->addItem(tr("5A"));
    cboBzSelect->addItem(tr("1A"));
    cboBzSelect->addItem(tr("100V"));
    cboBzSelect->addItem(tr("100/√3V"));
    cboBzSelect->addItem(tr("模拟小电压"));
  //  cboBzSelect->addItem(tr("谐波小电压"));
    cboBcSelect->addItem(tr("5A"));
    cboBcSelect->addItem(tr("1A"));
    cboBcSelect->addItem(tr("100V"));
    cboBcSelect->addItem(tr("100/√3V"));
    cboBcSelect->addItem(tr("模拟小电压"));
    cboBcSelect->addItem(tr("光纤 61850-9-1/2"));
    cboBcSelect->addItem(tr("光纤 FT3"));
    cboSave->addItem(tr("手动存储"));
    cboSave->addItem(tr("自动存储"));
    cboCyfs->addItem(tr("点对点方式"));
    cboCyfs->addItem(tr("组网方式"));
    cboCTPT->addItem(tr("电流互感器"));
    cboCTPT->addItem(tr("电压互感器"));
    cboInput->addItem(tr("光口1"));
    cboInput->addItem(tr("光口2"));
    cboInput->addItem(tr("电口1"));
    cboInput->addItem(tr("电口2"));
    for(int i=1;i<97;i++)
        cboBctd->addItem(QString::number(i));

    cboPBcSelect = new QComboBox;
    setView(cboPBcSelect);
    cboPBcSelect->setFont(ft);
    cboPBcSelect->setMinimumWidth(200);
    cboPBcSelect->addItem(tr("光纤 61850-9-2(LE)"));
    cboPBcSelect->addItem(tr("光纤 FT3"));
    changeBcSelect(0);
    connect(cboPBcSelect, SIGNAL(currentIndexChanged(int)), this, SLOT(changeBcSelect(int)));

    //changeSty(0);

    //tabwc->setAttribute(Qt::WA_TranslucentBackground,false);
    //widgetWc->setAttribute(Qt::WA_TranslucentBackground,false);
    QLabel *labTbfs=new QLabel(tr("同步方式"));
    QLabel *labBzSelect=new QLabel(tr("标准选择"));
    QLabel *labBcSelect=new QLabel(tr("被测选择"));
    labBctd=new QLabel(tr("被测通道"));
    QLabel *labCTPT=new QLabel(tr("互感器类型"));
    QLabel *labJD=new QLabel(tr("准确度等级"));
    labBhCl=new QLabel(tr("通道类型"));
    QLabel *labEdyc=new QLabel(tr("额定一次"));
    labBzXdy=new QLabel(tr("V"));
    labBcXdy=new QLabel(tr("V"));
    labCyfs=new QLabel(tr("采样方式"));
    labMac=new QLabel(tr("MAC地址"));
    QLabel *labSave=new QLabel(tr("存储方式"));
    QLabel *labTestNum=new QLabel(tr("测量次数"));

    labInput=new QLabel(tr("输入端口"));
    labInputMethod = new QLabel(tr("光口3"));
    labInputMethod->setFont(ft);
    labInputMethod->setStyleSheet("color:gold");

    labMUYS = new QLabel(tr("额定延时"));
    labMUYS->setFont(ft);
    txtMUYS = new QLineEdit(tr("0"));
    txtMUYS->setFont(ft);
    txtMUYS->setMinimumWidth(80);

    txtBzXdy->setMaxLength(7);
    txtBcXdy->setMaxLength(7);

    labTbfs->setFont(ft);
    labBzSelect->setFont(ft);
    labBcSelect->setFont(ft);
    labBctd->setFont(ft);
    labCTPT->setFont(ft);
    labJD->setFont(ft);
    labBhCl->setFont(ft);
    labEdyc->setFont(ft);
    labBzXdy->setFont(ft);
    labBcXdy->setFont(ft);
    labCyfs->setFont(ft);
    labMac->setFont(ft);
    labSave->setFont(ft);
    labTestNum->setFont(ft);
    labInput->setFont(ft);

    list_action=new QAction(tr("从扫描列表中获取"),this);
    scl_action=new QAction(tr("从配置文件中获取"),this);
    QMenu *menu=new QMenu();
    menu->addAction(list_action);
    menu->addAction(scl_action);
    btnGet->setMenu(menu);

    connect(list_action,SIGNAL(triggered()),this,SLOT(slotList()));
    connect(scl_action,SIGNAL(triggered()),this,SLOT(slotScl()));

    QHBoxLayout *tbLayout = new QHBoxLayout;
//    tbLayout->addWidget(labTbfs);
//    tbLayout->addWidget(cboTbfs);
    tbLayout->addWidget(labCTPT);
    tbLayout->addWidget(cboCTPT);
    tbLayout->addWidget(labMUYS);
    tbLayout->addWidget(txtMUYS);
    tbLayout->addStretch(1);
    QHBoxLayout *bzLayout = new QHBoxLayout;
    bzLayout->addWidget(labBzSelect);
    bzLayout->addWidget(cboBzSelect);
    bzLayout->addWidget(txtBzXdy);
    bzLayout->addWidget(labBzXdy);
    bzLayout->addStretch(1);
    QHBoxLayout *bcLayout = new QHBoxLayout;
    bcLayout->addWidget(labBcSelect);
    //bcLayout->addWidget(cboBcSelect);
    bcLayout->addWidget(cboPBcSelect);
    bcLayout->addWidget(txtBcXdy);
    bcLayout->addWidget(labBcXdy);
    bcLayout->addWidget(labBctd);
    bcLayout->addWidget(cboBctd);

    bcLayout->addStretch(1);
    QHBoxLayout *bctdLayout = new QHBoxLayout;
    bctdLayout->addSpacing(90);
    bctdLayout->addWidget(labBhCl);
    bctdLayout->addWidget(cboBhCl);
    bctdLayout->addStretch(1);
    QHBoxLayout *hgqLayout = new QHBoxLayout;
    hgqLayout->addWidget(labEdyc);
    hgqLayout->addWidget(txtEdyc);
    hgqLayout->addWidget(cboEdycDw);
    hgqLayout->addWidget(labJD);
    hgqLayout->addWidget(cboJD);
    hgqLayout->addStretch(1);
    QHBoxLayout *saveLayout = new QHBoxLayout;
    saveLayout->addWidget(labSave);
    saveLayout->addWidget(cboSave);
    saveLayout->addWidget(labTestNum);
    saveLayout->addWidget(txtTestNum);
    saveLayout->addStretch(1);
    QHBoxLayout *iecLayout = new QHBoxLayout;
    iecLayout->addWidget(labCyfs);
    iecLayout->addWidget(cboCyfs);
    iecLayout->addWidget(labInput);
    //iecLayout->addWidget(cboInput);
    iecLayout->addWidget(labInputMethod);
    iecLayout->addStretch(1);
    QHBoxLayout *macLayout = new QHBoxLayout;
    macLayout->addWidget(labMac);
    macLayout->addSpacing(5);
    macLayout->addWidget(txtMac);
    macLayout->addWidget(btnGet);
    macLayout->addStretch(1);
//    QHBoxLayout *MULayout = new QHBoxLayout;
//    MULayout->addWidget(labMUYS);
//    MULayout->addWidget(txtMUYS);
    QVBoxLayout *paraLayout = new QVBoxLayout;
    paraLayout->addLayout(tbLayout);
//    paraLayout->addLayout(MULayout);
    paraLayout->addLayout(hgqLayout);
    paraLayout->addLayout(bzLayout);
    paraLayout->addLayout(bcLayout);
    paraLayout->addLayout(bctdLayout);
    paraLayout->addLayout(saveLayout);
    paraLayout->addLayout(iecLayout);
    paraLayout->addLayout(macLayout);
    paraLayout->addStretch(1);

    QWidget *widgetPara = new QWidget;
    widgetPara->setFixedWidth(550);
    widgetPara->setLayout(paraLayout);

    //添加 btnTest
//    QHBoxLayout *btnLayout = new QHBoxLayout;

//    btnLayout->addStretch(1);
//    btnLayout->addWidget(btnTest);

    QVBoxLayout *layout= new QVBoxLayout;
    //layout->addLayout(btnLayout);
    layout->addLayout(gLayout);
    layout->addStretch(0);

    widgetWcTxt=new QWidget();
    widgetWcTxt->setLayout(layout);
    QHBoxLayout *wcLayout = new QHBoxLayout;
    wcLayout->addWidget(widgetPara);
    wcLayout->addWidget(widgetWcTxt);
    wcLayout->addStretch(1);
    widgetWc->setLayout(wcLayout);

    widgetWc->setStyleSheet(".QLabel{min-height:37px;}");

    QVBoxLayout *mainLayout = new QVBoxLayout;

    mainLayout->addWidget(tabwc);

    setLayout(mainLayout);
}

void F_WcPage::changeBcSelect(int index)
{
    if(index == 0)
    {
        cboBcSelect->setCurrentIndex(5);
    }
    else if(index == 1)
    {
        cboBcSelect->setCurrentIndex(6);
    }
}

void F_WcPage::changeSty(int flag)
{
    QString sty,sty1;
    sty="border: 1px solid #636363;border-radius: 5px;padding:2px;background:none;selection-background-color:#4D4D4D;color:#FFFFFF;background-color:rgb(30,66,92)";
    if (flag==0)
    {
        sty1="background-color:rgb(18,29,34);border:0px;";
     //   sty="background-color:rgb(30,66,92);color:rgb(255,255,255);";
    }
    else if (flag==1)
    {
        sty1="background-color:rgb(11,67,100);border:0px;";
     //   sty="background-color:rgb(30,66,92);color:rgb(255,255,255);";
    //    sty="border: 1px solid #636363;border-radius: 5px;padding:2px;background:none;selection-background-color:#4D4D4D;color:#FFFFFF;background-color:rgb(30,66,92)";
    }
    else if (flag==2)
    {
        sty1="background-color:rgb(53,53,53);border:0px;";
   //     sty="background-color:rgb(30,66,92);color:rgb(255,255,255);";
    }
    else if (flag==3)
    {
        sty1="background-color:rgb(21,87,110);border:0px;";
      //  sty="background-color:rgb(30,66,92);color:rgb(255,255,255);";
    }
   // tabwc->setStyleSheet(sty1);
    cboTbfs->setStyleSheet(sty);
    cboBzSelect->setStyleSheet(sty);
    cboBcSelect->setStyleSheet(sty);
    cboBctd->setStyleSheet(sty);
    cboCTPT->setStyleSheet(sty);
    cboJD->setStyleSheet(sty);
    cboBhCl->setStyleSheet(sty);
    cboEdycDw->setStyleSheet(sty);
    cboCyfs->setStyleSheet(sty);
    cboSave->setStyleSheet(sty);
    txtEdyc->setStyleSheet(sty);
    txtBzXdy->setStyleSheet(sty);
    txtBcXdy->setStyleSheet(sty);
    txtMac->setStyleSheet(sty);
    txtTestNum->setStyleSheet(sty);
    btnGet->setStyleSheet(sty);
    cboInput->setStyleSheet(sty);
}

void  F_WcPage::slotList()
{
    emit f_sigList();
}

void  F_WcPage::slotScl()
{
    emit f_sigScl();
}
